{#<!DOCTYPE html>#}
{#<html lang="zh-CN">#}
{#<head>#}
{#    <meta charset="UTF-8">#}
{#    <meta name="viewport" content="width=device-width, initial-scale=1.0">#}
{#    <title>查看文件</title>#}
{#    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">#}
{#    <style>#}
{#        body {#}
{#            background-color: #f8f9fa;#}
{#            font-family: 'Arial', sans-serif;#}
{#        }#}
{##}
{#        .container {#}
{#            max-width: 800px;#}
{#            margin-top: 50px;#}
{#            background: white;#}
{#            padding: 20px;#}
{#            border-radius: 10px;#}
{#            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);#}
{#        }#}
{##}
{#        .card {#}
{#            border: none;#}
{#            border-radius: 10px;#}
{#            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);#}
{#        }#}
{##}
{#        .card-header {#}
{#            background-color: #007bff;#}
{#            color: white;#}
{#            font-weight: bold;#}
{#            text-align: center;#}
{#        }#}
{##}
{#        .card-body p {#}
{#            margin-bottom: 10px;#}
{#        }#}
{##}
{#        .info-group {#}
{#            display: flex;#}
{#            flex-wrap: wrap;#}
{#            gap: 10px;#}
{#        }#}
{##}
{#        .info-item {#}
{#            flex: 1 1 calc(50% - 10px);#}
{#            background-color: #f8f9fa;#}
{#            padding: 15px;#}
{#            border-radius: 8px;#}
{#            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);#}
{#        }#}
{##}
{#        .info-item strong {#}
{#            display: block;#}
{#            margin-bottom: 5px;#}
{#            color: #555;#}
{#        }#}
{##}
{#        .btn-group {#}
{#            display: flex;#}
{#            justify-content: center;#}
{#            gap: 15px;#}
{#        }#}
{##}
{#        .btn {#}
{#            width: 150px;#}
{#        }#}
{##}
{#        footer {#}
{#            text-align: center;#}
{#            padding: 15px 0;#}
{#            color: #6c757d;#}
{#            font-size: 14px;#}
{#            margin-top: 20px;#}
{#        }#}
{#    </style>#}
{#</head>#}
{#<body>#}
{#<div class="container">#}
{#    <h2 class="text-center mb-4">查看文件</h2>#}
{##}
{#    <!-- 文件详细信息 -->#}
{#    <div class="card">#}
{#        <div class="card-header">#}
{#            文件详细信息#}
{#        </div>#}
{#        <div class="card-body">#}
{#            <div class="info-group">#}
{#                <div class="info-item">#}
{#                    <strong>文件名</strong>#}
{#                    {{ file_record.file_name }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>关联类别</strong>#}
{#                    {{ file_record.category }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>关联记录编号</strong>#}
{#                    {{ file_record.related_record_id|default:"无" }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>描述</strong>#}
{#                    {{ file_record.file_description }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>状态</strong>#}
{#                    {{ file_record.get_status_display }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>文件哈希值</strong>#}
{#                    {{ file_record.file_hash }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>操作理由</strong>#}
{#                    {{ file_record.operation_reason }}#}
{#                </div>#}
{#                <div class="info-item">#}
{#                    <strong>上传时间</strong>#}
{#                    {{ file_record.created_at }}#}
{#                </div>#}
{#            </div>#}
{#        </div>#}
{#    </div>#}
{##}
{#    <!-- 操作按钮 -->#}
{#    <div class="btn-group mt-4">#}
{#        <a href="{% url 'preview' %}" class="btn btn-secondary">返回列表</a>#}
{#        <a href="{% url 'download_file' file_record.id %}" class="btn btn-success">下载文件</a>#}
{#        <a href="{% url 'preview_file' file_record.id %}" class="btn btn-info">在线预览</a>#}
{#    </div>#}
{#</div>#}
{##}
{#<footer>#}
{#    &copy; 2025 信息管理系统 - 版权所有#}
{#</footer>#}
{##}
{#<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>#}
{#</body>#}
{#</html>#}






<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查看文件</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: 'Arial', sans-serif;
        }

        .container {
            max-width: 800px;
            margin-top: 50px;
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .card {
            border: none;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
        }

        .card-header {
            background-color: #007bff;
            color: white;
            font-weight: bold;
            text-align: center;
        }

        .card-body p {
            margin-bottom: 10px;
        }

        .info-group {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .info-item {
            flex: 1 1 calc(50% - 10px);
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .info-item strong {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }

        .btn-group {
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .btn {
            width: 150px;
        }

        footer {
            text-align: center;
            padding: 15px 0;
            color: #6c757d;
            font-size: 14px;
            margin-top: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <h2 class="text-center mb-4">查看文件</h2>

    <!-- 文件详细信息 -->
    <div class="card">
        <div class="card-header">
            文件详细信息
        </div>
        <div class="card-body">
            <div class="info-group">
                <div class="info-item">
                    <strong>文件名</strong>
                    {{ file_record.file_name }}
                </div>
                <div class="info-item">
                    <strong>关联类别</strong>
                    {{ file_record.category }}
                </div>
                <div class="info-item">
                    <strong>关联记录编号</strong>
                    {{ file_record.related_record_id|default:"无" }}
                </div>
                <div class="info-item">
                    <strong>描述</strong>
                    {{ file_record.file_description }}
                </div>
                <div class="info-item">
                    <strong>文件哈希值</strong>
                    {{ file_record.file_hash }}
                </div>
                <div class="info-item">
                    <strong>上传时间</strong>
                    {{ file_record.created_at }}
                </div>
                <div class="info-item">
                    <strong>上传者</strong>
                    {{ file_record.uploaded_by|default:"未知" }}
                </div>
            </div>
            <div class="info-item mt-4">
                <strong>操作理由</strong>
                {{ file_record.operation_reason }}
            </div>
        </div>
    </div>

    <!-- 操作按钮 -->
    <div class="btn-group mt-4">
        <a href="{% if request.user.role == 'user' %}{% url 'preview_user' %}{% else %}{% url 'preview' %}{% endif %}" class="btn btn-primary mx-2">
            返回文件列表
        </a>
        <a href="{% url 'download_file' file_record.id %}" class="btn btn-success">下载文件</a>
        <a href="{% url 'preview_file' file_record.id %}" class="btn btn-info">在线预览</a>
    </div>
</div>

<footer>
    &copy; 2025 信息管理系统 - 版权所有
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

